<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .a {
            width: 100px;
            height: 100px;
            background-color: #f00;

            transition: .3s;
        }

        .a:hover {
            /* 占位置的  --- 会影响其他元素 */
            /* margin-top: -25px; */
            /* 保留原来的位置 */
            /*  */
            /* transform 转换     translate(x,y)位移*/
            /* translateX()    translateY() */
            /* translate3d(x,y,z) */
            transform: translateY(-2px);
            box-shadow: 0 2px 2px 0px #ddd;
        }
    </style>
</head>

<body>



    <div class="a"></div>
    <h1>111111111111</h1>

</body>

</html>